package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.LumiereMemberWelfareCouponMapper;
import org.linlinjava.litemall.db.domain.LumiereMemberWelfareCoupon;
import org.linlinjava.litemall.db.domain.LumiereMemberWelfareCouponExample;
import org.linlinjava.litemall.db.domain.LumiereMemberWelfareSubscribeExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LumiereMemberWelfareCouponService {

    @Resource
    private LumiereMemberWelfareCouponMapper lumiereMemberWelfareCouponMapper;

    public void add(LumiereMemberWelfareCoupon lumiereMemberWelfareCoupon){
        lumiereMemberWelfareCouponMapper.insert(lumiereMemberWelfareCoupon);
    }

    public void deleteByExample(LumiereMemberWelfareCouponExample example){
        lumiereMemberWelfareCouponMapper.deleteByExample(example);
    }

    public List<LumiereMemberWelfareCoupon> findByMemberId(Integer memberId,Byte type){
        LumiereMemberWelfareCouponExample example = new LumiereMemberWelfareCouponExample();
        example.or().andMemberIdEqualTo(memberId).andMemberTypesEqualTo(type);
        return lumiereMemberWelfareCouponMapper.selectByExample(example);
    }

}
